<!--
 * @Author: HeAo
 * @Date: 2022-08-24 19:41:52
 * @LastEditTime: 2022-08-24 19:44:49
 * @LastEditors: HeAo
 * @Description: 
 * @FilePath: \JavaScripe\day-13事件机制\08-焦点事件.html
 * 别乱动！
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <input type="text" name="" id="inp">
  <script>
    var inp = document.getElementById('inp')
    // onfocus-聚焦
    inp.onfocus = function () {
      console.log('focus');
    }
    // onblur-失焦
    inp.onblur = function (event) {
      // event.target.value 输入框内的值
      console.log('onblur' + event.target.value);
    }
  </script>


</body>

</html>